package cn.com.czpb.client.module.personal.acticity;//package cn.com.gxrb.client.module.personal.acticity;
//
//import android.os.Bundle;
//import android.view.View;
//import android.widget.EditText;
//import android.widget.TextView;
//
//import cn.com.gxrb.client.R;
//import cn.com.gxrb.client.app.ToolBarActivity;
//import cn.com.gxrb.client.model.usercenter.EmptyEntity;
//import cn.com.gxrb.client.net.Factory;
//import cn.com.gxrb.client.utils.LogUtils;
//import cn.com.gxrb.client.utils.ParamUtils;
//import cn.com.gxrb.client.utils.TUtils;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import butterknife.BindView;
//import butterknife.OnClick;
//import rx.android.schedulers.AndroidSchedulers;
//import rx.functions.Action1;
//import rx.functions.Func1;
//import rx.schedulers.Schedulers;
//
//public class ChangePwActivity extends ToolBarActivity {
//    @BindView(R.id.tv_title)
//    TextView tv_title;
//    @BindView(R.id.oldpw_activity_pw)
//    EditText oldpw_activity_pw;
//    @BindView(R.id.new1_pw_activity_change)
//    EditText new1_pw_activity_change;
//    @BindView(R.id.new2_pw_activity_change)
//    EditText new2_pw_activity_change;
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        tv_title.setText("修改密码");
//        new1_pw_activity_change.setHint("新密码");
//    }
//
//
//    @Override
//    public int setMyContentView() {
//        return R.layout.activity_change_pw;
//    }
//
//    @OnClick(R.id.ok_pw_activity_change)
//    public void changePW(View view) {
//
//        String old = oldpw_activity_pw.getText().toString().trim();
//        String new1 = new1_pw_activity_change.getText().toString().trim().trim();
//        String new2 = new2_pw_activity_change.getText().toString();
////        Intent  intent=getIntent();
////        type=intent.getIntExtra(InterfaceJsonfile.PWDTYPE,2);
//
//        if (old == null || "".equals(old)) {
//            TUtils.toast("请输入旧密码");
//            return;
//        }
////        if (!old.equals(spu.getUser().getPassword())){
////            TUtils.toast("密码输入不正确");
////            return;
////        }
//        if (new1 == null || "".equals(new1)) {
//            TUtils.toast("请输入新密码");
//            return;
//        }
//        if (new2 == null || "".equals(new2)) {
//            TUtils.toast("请再次输入新密码");
//            return;
//        }
//        if (!new1.equals(new2)) {
//            TUtils.toast("两次输入的结果不一致");
//            new1_pw_activity_change.setText("");
//            oldpw_activity_pw.setText("");
//            new2_pw_activity_change.setText("");
//            return;
//        }
//
//        if (new1.length() < 6) {
//            TUtils.toast("密码不能太短");
//            return;
//        }
//        if (new1.length() > 12) {
//            TUtils.toast("密码不能太长");
//            return;
//        }
//        showDialog();
//
//        changePwd(old, new2);
//
//    }
//
//    private void changePwd(String oldpwd, String newPwd) {
//
//        Map<String, String> map = new HashMap<>();
//        map.put("uid", spu.getUser().getUid());
//
//        map.put("oldpassword", oldpwd);
//        map.put("newpassword", newPwd);
////        Factory.provideHttpService().changePassWord(ParamUtils.getRequestParam(map))
////                .onBackpressureBuffer()
////                .subscribeOn(Schedulers.io())
////                .filter(new Func1<EmptyEntity, Boolean>() {
////                    @Override
////                    public Boolean call(EmptyEntity emptyEntity) {
////
////                        LogUtils.e("PW---" + emptyEntity.code);
//////                        if ("200".equals(superEntity.code)){
//////
//////                            return true;
//////                        }
////                        return true;
////                    }
////                })
////                .observeOn(AndroidSchedulers.mainThread())
////                .subscribe(new Action1<EmptyEntity>() {
////                    @Override
////                    public void call(EmptyEntity emptyEntity) {
////                        disMissDialog();
////                        if ("200".equals(emptyEntity.code)) {
////                            TUtils.toast(emptyEntity.msg);
////                            activity.finish();
////                        } else {
////                            TUtils.toast(emptyEntity.msg);
////                        }
////
////
////                    }
////
////                }, new Action1<Throwable>() {
////                    @Override
////                    public void call(Throwable throwable) {
////
////                    }
////                });
//
//    }
//}
